<%--
    Document   : index
    Created on : 12.02.2010, 22:48:51
    Author     : Morfant
--%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="stud.cp.user.valueobjects.Property"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java"%>

<html>
    <%@include file="/header.jsp" %>
    <body>
        <div class="page">
            <%@include file="/cap.jsp" %>
            <div id="main">
                <h2>Список пользователей</h2>
                <table id="buttontable">
                    <tr>
                        <th>
                            <div id="objectmenucontainer">
                                <ul id="objectmenu">
                                    <li><a href="<%= response.encodeURL("admin-action.do")
                                                            + "?"
                                                            + PluginConst.SUBACTION
                                                            + "="
                                                            + PluginConst.GET_ADD_PAGE%>">Добавить</a></li>
                                </ul>
                            </div>
                        </th>
                    </tr>
                </table>
                <% List<User> list =
                                    (List<User>) request.getAttribute(PluginConst.USERS_LIST);
                            if ((list != null)&&(list.size()>0)) {%>
                <table>
                    <tr>
                        <th>
                        </th>
                        <th>
                            Логин
                        </th>
                        <th>
                            Тип
                        </th>
                    </tr>
                    <%for (User item : list) {%>
                    <tr>
                        <td>
                            <div id="objectmenucontainer">
                                <ul id="objectmenu">
                                    <li><a href="<%= response.encodeURL("admin-action.do")
                                                            + "?"
                                                            + PluginConst.SUBACTION
                                                            + "="
                                                            + PluginConst.GET_EDIT_PAGE
                                                            + "&"
                                                            + PluginConst.USER_ID
                                                            + "="
                                                            + item.getUserID()%>">Редактировать</a></li>
                                           <br>
                                           <li><a href="<%= response.encodeURL("admin-action.do")
                                                                   + "?"
                                                                   + PluginConst.SUBACTION
                                                                   + "="
                                                                   + PluginConst.GET_DELETE_PAGE
                                                                   + "&"
                                                                   + PluginConst.USER_ID
                                                                   + "="
                                                                   + item.getUserID()%>">Удалить</a></li>
                                </ul>
                            </div>
                        </td>
                        <td>
                            <%= item.getName()%>
                        </td>
                        <td>
                            <%= item.getUserTypeName()%>
                        </td>
                    </tr>
                    <% }%>
                </table>
                <% }%>
            </div>
        </div>
    </body>
</html>
